export const statusList = [
  { label: "正常", value: 1 },
  { label: "失效", value: 2 },
];

export const statusMap = statusList.reduce((prev, next) => {
  prev[next.value] = next.label;
  return prev;
}, {});

export const roleList = [
  { label: "超级管理员", value: 2 },
  { label: "子管理员", value: 1 },
  { label: "用户", value: 0 },
];

export const roleMap = roleList.reduce((prev, next) => {
  prev[next.value] = next.label;
  return prev;
}, {});

// 生成年份选项（从明年往前推30年）- 数字数组格式
const currentYear = new Date().getFullYear() + 1;
export const yearOptions = Array.from({ length: 30 }, (_, i) => currentYear - i);

// 生成年份选项（从1990年到当前年）- 对象数组格式，用于统计查询
const currentYearNow = new Date().getFullYear();
export const yearOptionsWithLabel = Array.from(
  { length: currentYearNow - 1990 + 1 },
  (_, i) => ({
    label: `${1990 + i}年`,
    value: 1990 + i,
  })
);

// 审批状态映射
export const approvalStatusMap = {
  pending: '待审批',
  approved: '已通过',
  rejected: '已拒绝',
  in_progress: '进行中',
}

// 审批状态类型映射（用于 Element Plus 标签类型）
export const approvalStatusTypeMap = {
  pending: 'warning',
  approved: 'success',
  rejected: 'danger',
  in_progress: 'primary',
}

// 审批类型映射
export const approvalTypeMap = {
  student_infor_flow: '学生信息审批流程',
  student_ent_teacher_flow_1: '学生企业导师审批流程',
  student_ent_teacher_flow: '学生企业导师审批流程',
  student_school_teacher_flow: '学生高校导师审批流程',
  ent_join_manage_flow: '入企实践管理',
  ent_plan_flow: '制定企业计划',
  ent_progress_flow: '制定实践进度',
  enroll_flow: '报名审批流程',
}